﻿//-----------------------------------------------------------------------
// <copyright file="Parameter.cs" company="tuliprules.org">
//     Copyright (c) 2010 tuplelister, tuliprules.org.
// </copyright>
// <summary>This is the Parameter class.</summary>
//-----------------------------------------------------------------------

namespace Tulip.Engine.Models.ClosedWorld
{
    /// <summary>
    /// Represents a parameter of a bound member (including generic type arguments).
    /// </summary>
    ////[ContentProperty("BoundType")]
    public class Parameter : ElementBase
    {
        /// <summary>
        /// Gets or sets a value indicating whether the parameter is passed by reference.
        /// </summary>
        public bool IsByRef { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the parameter is outbound.
        /// </summary>
        public bool IsOut { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether an out parameter is used as the return type.
        /// </summary>
        public bool IsReturn { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the parameter is a params array.
        /// </summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Params", Justification = "Intended spelling.")]
        public bool IsParams { get; set; }

        /// <summary>
        /// Gets or sets the reference to .NET type of parameter.
        /// </summary>
        public string TypeRef { get; set; }

        /// <summary>
        /// Gets or sets the name of the generic type argument for this parameter.
        /// </summary>
        /// <remarks>
        /// If this value is not null or empty, then it is assumed that the
        /// bound type is bound to a generic type argument of the same name
        /// on the member.   It is not necessary to define type arguments
        /// as part of the model, because they are already defined on the
        /// .NET type bound to by entity tuples.   Likewise, it is not
        /// necessary to define constraints.   Constraint violation can
        /// be reported at compile time, or analysed up front when defining
        /// high-level rules.   This is simply a hint to the implementor
        /// that we are binding the given type to a generic parameter.
        /// </remarks>
        public string GenericTypeArgument { get; set; }
    }
}
